Skip to content

Feature/ 12 Setup E2E tests#100

Merged
MasterEvarior merged 4 commits into
mainfrom
feature/12-setup-e2e-test
Sep 19, 2025
Merged

Feature/ 12 Setup E2E tests#100
MasterEvarior merged 4 commits into
mainfrom
feature/12-setup-e2e-test

Conversation

@Miguel7373

Copy link
Copy Markdown
Collaborator

No description provided.

@Miguel7373 Miguel7373 changed the base branch from main to feature/4-docker-and-docker-compose September 10, 2025 07:32
@Miguel7373 Miguel7373 force-pushed the feature/12-setup-e2e-test branch from c1f413f to c5e2876 Compare September 10, 2025 09:22
@Miguel7373 Miguel7373 linked an issue Sep 10, 2025 that may be closed by this pull request
6 tasks
@mmoeri mmoeri force-pushed the feature/12-setup-e2e-test branch from 2465bb4 to 493c180 Compare September 10, 2025 11:59
@mmoeri mmoeri force-pushed the feature/4-docker-and-docker-compose branch from 4a6a91b to 7e872e5 Compare September 12, 2025 08:57
Base automatically changed from feature/4-docker-and-docker-compose to main September 12, 2025 09:10
@mmoeri mmoeri force-pushed the feature/12-setup-e2e-test branch 2 times, most recently from 23826ef to 3ebcf43 Compare September 12, 2025 11:06
@MasterEvarior

MasterEvarior commented Sep 15, 2025

Copy link
Copy Markdown
Collaborator

Over the weekend I had an idea to solve the URL problem, which may even work.

Currently we are sending all requests to the frontend container, which then proxies it to the backend container. Instead we could directly send our API requests to the backend. This way we wouldn't need to adjust the nginx config at all.

We can achieve this through the build environments in Angular. Set the URL for each environment and then prepend it to each call to the API:

// Imaginary example
import { environment } from '../environments/environment';
 
export class RoleService {
  private crudUrl = environment.apiUrl + '/roles';
 
  constructor(private http: HttpClient) {}
 
  getRoles$(): Observable<RolesDto> {
    return this.http.get<RolesDto>(this.crudUrl);
  }
 
 ...
}

The build environment can then be passed through an env variable to the dockerfile, which builds the app with the correct URL and whatnot:

//dockerfile
RUN npm run build -- --output-path=./dist/ --configuration=$PCTS_FRONTEND_ENVIRONMENT

I haven't tried this, so do not get fixated on this in case it does not work but it is worth a try.

@peggimann

Copy link
Copy Markdown
Collaborator

I had a quick look at the issue, i propose the following solution:
We use the docker compose overlay mechanism as described here: https://docs.docker.com/compose/how-tos/multiple-compose-files/merge/

We could make an compose.e2e.yaml file which sets the property SPRING_PROFILES_ACTIVE to e2e or whatever profile is used from the spring backend in order to start it in e2e mode.

Starting the correct config should then theoretically reduce to a docker compose up -f compose.e2e.yaml

As far as i am concerned this should already solve all the proxy problems encountered and would be a clean extension from the base image to make it ready for e2e testing without the need to maintain 2 services.

Keep in mind this is not tested just a quick research on the topic brought me to this idea please evaluate in detail.

Comment thread tools/e2e-application-start
@mmoeri mmoeri force-pushed the feature/12-setup-e2e-test branch 2 times, most recently from f0b68db to 773e3fd Compare September 17, 2025 11:01
@mmoeri mmoeri marked this pull request as ready for review September 17, 2025 11:15

@MasterEvarior MasterEvarior left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some very minor things, everything else is bonita 💅

Comment thread frontend/README.md
Comment thread .github/workflows/reusable__e2e-testing.yaml Outdated
@mmoeri mmoeri force-pushed the feature/12-setup-e2e-test branch from 3ace14a to 08bdbb2 Compare September 19, 2025 05:51
@MasterEvarior MasterEvarior merged commit d3184c1 into main Sep 19, 2025
9 checks passed
@MasterEvarior MasterEvarior deleted the feature/12-setup-e2e-test branch September 19, 2025 06:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Technical Story: Setup E2E Tests

4 participants